from selenium.webdriver.common.by import By


class PersonalOrganizationLocator:
    pesonal_user_tab = (By.XPATH, "//div[contains(@data-menu-id,'MANAGEMENT_PLT_PERSONAL_USER')]")

    organization_tab = (By.CSS_SELECTOR, '[path="/console/organization/personalUser"]')

    # 翻页
    page_total = (By.CSS_SELECTOR, '[class="antd4-pagination-total-text"]')

    # 组织名称查询输入框
    organization_query_input = (By.XPATH, "//div[contains(@class,'leftContent')]//input")

    # 查询组织名称
    organization_query_button = (By.XPATH, "(//button[contains(@class,'search-button')])[1]")

    # 组织列表的元素 20240408 样式变更
    #organization_name_list_eles = (By.CSS_SELECTOR, '[class="ant-tree-title"]')
    organization_name_list_eles = (By.XPATH, '//div[@class="antd4-tree-list"]//span[@class="antd4-tree-title"]/span')

    # 组织成员查询框
    immediate_member_search_input = (By.ID, 'creForm_searchVal')

    # 查询组织名称
    immediate_member_query_button = (By.XPATH, "(//button[contains(@class,'search-button')])[2]")

    # immediate_member_query_result
    immediate_member_query_result = (By.XPATH, "//tr[contains(@class,'antd4-table-row')]")

    # 加载转菊花
    loading_wait = (By.CSS_SELECTOR, '[class="antd4-spin-dot antd4-spin-dot-spin"]')

    # 筛选按钮
    filter = (By.XPATH, "//span[contains(@class,'table-filter-trigger')]/span")

    # 筛选项_normal
    filter_normal = (By.XPATH, '//*[text()="Normal"]/ancestor::span[@class="antd4-dropdown-menu-title-content"]')

    # 确认选择项
    filter_ok = (By.XPATH, '//span[text()="OK"]/..')

    # 状态
    filter_status = (By.XPATH, "//span[contains(@class,'badge-status-text')]")

    # reset_pwd
    reset_pwd = (By.XPATH, '//button[contains(@class,"table-operation-btnLine-btn")]')

    # delete_org_ack
    delete_org_ack = (By.XPATH, '//div[@role="dialog"]//input/..')

    # 编辑组织确认
    operation_confirm = (By.XPATH, "//div[contains(@class,'modal-footer')]/button[2]")

    # 成功提示
    success_prompt = (By.XPATH, "//div[contains(@class,'antd4-message-success')]")

    # 组织成员列表字段
    list_columns = (By.CSS_SELECTOR, "tr th.antd4-table-cell")

    # status字段
    list_column_status = (By.CSS_SELECTOR, "tr th.antd4-table-cell span.antd4-table-column-title")

    # 展开status选项
    status_checkbox = (By.CSS_SELECTOR, "tr th.antd4-table-cell span[role='button']")

    # status选项
    status_checkbox_options = (By.CSS_SELECTOR, "span.antd4-dropdown-menu-title-content>span")

    # reset password button
    #reset_pwd_button = (By.XPATH, "//button[contains(@class,'antd4-btn-link')]/span[not(@class)]")
    reset_pwd_button = (By.XPATH, '//*[text()="Reset Password"]')

    # 用户操作按钮
    user_options_ellipsis = (By.XPATH, "//span[contains(@class,'table-operation-ellipsis')]")

    # 展开的用户操作
    lock_button = (By.XPATH, '//span[text()="Lock"]')
    unlock_button = (By.XPATH, '//span[text()="Unlock"]')
    lock_button_area = (By.XPATH, '//span[text()="Lock"]')
    unlock_button_area = (By.XPATH, '//span[text()="Unlock"]')

    # 二次确认窗口的提示语
    reset_prompt_lines = (By.CSS_SELECTOR, "div.main___1Mt3G>div>div")
    lock_prompt_lines = (By.CSS_SELECTOR, "div.main___1Mt3G>div>div>div")

    # 二次确认窗口的accept选框
    accept_ack = (By.XPATH, '//div[@role="dialog"]//input/..')

    # 二次确认窗口的确认按钮
    confirm_button = (By.XPATH, "//div[contains(@class,'modal-footer')]/button[2]")

    # success_pup
    success_pup = (By.XPATH, "//div[@class='antd4-message-notice-content']//span[not(@class)]")